package TP2;

public class Client extends Thread {
	private static int nbClients;
	private Site depart;
	private Site arrivee;

	public Client(int nbClients, Site depart, Site arrivee) {
		this.nbClients = nbClients;
		this.depart = depart;
		this.arrivee = arrivee;
	}

	public void run() {
		depart.emprunter();
		try {
			Thread.sleep(arrivee.getNbSites() - depart.getNbSites());
		} catch (InterruptedException e) {
		}
		arrivee.deposer();
		nbClients--;
	}

	public static int getNbClients() {
		return nbClients;
	}
}
